﻿package com.tudou.home.newskin.containers
{
    import com.tudou.consts.*;
    import com.tudou.home.newskin.buttons.*;
    import flash.display.*;
    import flash.text.*;

    public class LoadingSprite extends Sprite
    {
        private var loading:DisplayObject;
        private var text:TextField;

        public function LoadingSprite()
        {
            var _loc_1:int = 185;
            var _loc_2:int = 90;
            graphics.beginFill(0, 0.45);
            graphics.drawRoundRectComplex(0, 0, _loc_1, _loc_2, 10, 10, 10, 10);
            graphics.endFill();
            loading = new LoadingCircle();
            loading.x = int(_loc_1 / 2);
            loading.y = int(_loc_2 / 2 - 14);
            addChild(loading);
            text = new TextField();
            text.borderColor = 16711680;
            text.width = _loc_1;
            text.defaultTextFormat = new TextFormat("宋体", 14, 16777215, true);
            text.text = "正在切换到原画版本";
            text.selectable = false;
            text.mouseEnabled = false;
            text.autoSize = TextFieldAutoSize.CENTER;
            text.y = int(_loc_2 / 2 + 17);
            addChild(text);
            return;
        }// end function

        override public function set visible(param1:Boolean) : void
        {
            loading.visible = param1;
            super.visible = param1;
            return;
        }// end function

        public function setRateType(param1:int) : void
        {
            var _loc_2:String = "";
            switch(param1)
            {
                case RateType.ORIGINAL:
                {
                    _loc_2 = "原画";
                    break;
                }
                case RateType.P720:
                {
                    _loc_2 = "720P";
                    break;
                }
                case RateType.P480:
                {
                    _loc_2 = "480P";
                    break;
                }
                case RateType.P360:
                {
                    _loc_2 = "360P";
                    break;
                }
                case RateType.P256:
                {
                }
                default:
                {
                    _loc_2 = "256P";
                    break;
                    break;
                }
            }
            text.text = "正在切换到" + _loc_2 + "版本";
            return;
        }// end function

    }
}
